package printers;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;

public class Concatinator {

	private static File concatSequence;
	private static File output;

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		concatSequence = new File("src/strains/ConcatSequences.txt");
		output = new File("src/strains/output.txt");
		for(int i=0;i<=1028;i++){
			printToFile(getSeq(i));
		}
			

	}
	
	private static String getSeq(int linen) throws IOException{
			BufferedReader buffRead= new BufferedReader(new FileReader(concatSequence));
			String res=linen+"	";
			String line="";
			int lineNum=linen*2;
			int count=0;
			while(lineNum!=count){line=buffRead.readLine();count++;}//System.out.println(line);}
			System.out.println(res+line);
		//	line=buffRead.readLine();
			return res+line;
		
	}
	
	public static void printToFile(String line) throws IOException{
		try{
			PrintWriter out = new PrintWriter(new FileOutputStream(output,true));
			out.println(line);
			out.close();
		}catch (IOException e){}
		
	}

}
